package cn.itcast.itcaststore.dao;

import cn.itcast.itcaststore.domain.User;

import java.sql.SQLException;

public interface UserDao {


    /**
     * 添加用户
     * @param user
     * @throws SQLException
     */
    void addUser(User user) throws SQLException;



    /**
     *  根据激活码查找用户
     * @param activeCode
     * @return
     * @throws SQLException
     */
    User findUserByActiveCode(String activeCode) throws SQLException;



    /**
     * 激活用户
     * @param activeCode
     * @throws SQLException
     */
    int activeUser(String activeCode) throws SQLException;



    /**
     * 根据用户名与密码查找用户
     * @param username
     * @param password
     * @return
     * @throws SQLException
     */
    User findUserByUsernameAndPassword(String username,String password) throws SQLException;
}
